home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / c / ExtrasLib.lha / ExtrasLib / Source / boopsi_GetGInfo.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-30  |  1.3 KB  |  61 lines

  1. #include <intuition/classusr.h>
  2. #include <intuition/cghooks.h>
  3. #include <intuition/gadgetclass.h>
  4.  
  5. #include <clib/extras_protos.h>
  6. #include <clib/extras/boopsi_protos.h>
  7.  
  8. /****** extras.lib/boopsi_GetGInfo ******************************************
  9. *
  10. *   NAME
  11. *       boopsi_GetGInfo -- Get the GadgetInfo pointer from common BOOPSI messages
  12. *
  13. *   SYNOPSIS
  14. *       ginfo = boopsi_GetGInfo(Message)
  15. *
  16. *       struct GadgetInfo *boopsi_GetGInfo(Msg);
  17. *
  18. *   FUNCTION
  19. *       Gets the pointer to the GadgetInfo structure from a BOOPSI
  20. *       message.
  21. *
  22. *   INPUTS
  23. *       Message - BOOPSI message pointer.
  24. *
  25. *   RESULT
  26. *       pointer to GadgetInfo structure or NULL.
  27. *
  28. *   NOTES
  29. *       Only handles OM_SET, OM_UPDATE, OM_NOTIFY, GM_HITTEST,
  30. *       GM_RENDER, GM_GOACTIVE, GM_HANDLEINPUT, GM_GOINACTIVE
  31. *       and GM_LAYOUT methods.
  32. *
  33. *   BUGS
  34. *
  35. *   SEE ALSO
  36. *
  37. ******************************************************************************
  38. *
  39. */
  40.  
  41. struct GadgetInfo *boopsi_GetGInfo(Msg Message)
  42. {
  43.   switch(Message->MethodID)
  44.   {
  45.     case OM_SET:
  46.     case OM_UPDATE:
  47.     case OM_NOTIFY:
  48.       return( ((struct opSet *)Message)->ops_GInfo );
  49.       
  50.     case GM_HITTEST:
  51.     case GM_RENDER:
  52.     case GM_GOACTIVE:
  53.     case GM_HANDLEINPUT:
  54.     case GM_GOINACTIVE:
  55.     case GM_LAYOUT:
  56.       return( ((struct gpHitTest *)Message)->gpht_GInfo );
  57.   }
  58.   return(0);
  59. }
  60.       
  61.